package com.qianzhou.page;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * @Author: qian.zhou
 * @Description:
 * @Date Created in 2021-09-12-9:33
 * @Modified By:
 */
@SpringBootApplication
@MapperScan("com.qianzhou.common.mapper")
@EnableDiscoveryClient
// @EnableCircuitBreaker // 开启熔断
@EnableFeignClients // 开启Feign
public class ServicePageApplication9101 {
    public static void main(String[] args) {
        SpringApplication.run(ServicePageApplication9101.class, args);
    }

    @Bean
    //Ribbon负载均衡
    @LoadBalanced
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
    /*
     * 1.服务管理：自动注册与发现，状态监管  Eureka  Zookeeper NaCos
     * 2.服务负载均衡： 客户端的负载均衡 Ribbon  服务端的负载均衡 Nginx
     * 3.熔断: hystrix
     * 4.远程过程调用：Feign Dubbo RPC
     * 5.网关拦截和路由转发 统一认证： GateWay zuul
     * 6.集中式配置管理，配置信息实时自动更新： spring cloud config   spring cloud bus
     * */
}
